//
//  MYShareCollectionViewCell.m
//  JQLive
//
//  Created by Bruce on 2020/3/9.
//  Copyright © 2020 JQLive. All rights reserved.
//

#import "MYShareCollectionViewCell.h"

@implementation MYShareCollectionViewCell

@synthesize iconImgView = _iconImgView;
@synthesize titleLabel = _titleLabel;

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        _iconImgView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.iconImgView];
        
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.textColor = MY_Text_Color_Theme1;
        _titleLabel.font = [UIFont systemFontOfSize:10];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.titleLabel];
        
        [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(@10);
            make.centerX.equalTo(self.contentView);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self.iconImgView.mas_bottom).offset(20);
        }];
    }
    return self;
}

- (void)updateContent:(id)data
{
    NSDictionary *dict = data;
    
    _iconImgView.image = [UIImage imageNamed:dict[@"icon"]];
    _titleLabel.text = dict[@"title"];
}

@end
